<template>
  <div class="guide">
    <el-button icon="el-icon-question" type="primary" @click="guide">
      Show Guide
    </el-button>
    <div class="vchart-box">
      <div class="vchart-row">
        <div class="vchart-item">
          <barVChart></barVChart>
        </div>
        <div class="vchart-item">
          <lineVChart></lineVChart>
        </div>
        <div class="vchart-item">
          <clockVChart></clockVChart>
        </div>
      </div>
      <div class="vchart-row">
        <div class="vchart-item">
          <scatterVChart></scatterVChart>
        </div>
        <div class="vchart-item">
          <dynamicLine></dynamicLine>
        </div>
        <div class="vchart-item">
          <dynamicBar></dynamicBar>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import {driver} from 'driver.js'
import 'driver.js/dist/driver.css'
import steps from './steps'
const state = reactive({
  driver: null,
  user: 'zws'
})
const {user} = toRefs(state)
onMounted(() => {
  state.driver = driver()
})
const guide = () => {
  state.driver.setSteps(steps)
  state.driver.drive()
}
</script>

<style lang="scss" scoped>
.guide {
  width: 100%;
  height: 100%;

  .vchart-box {
    width: 100%;
    height: calc(100% - 20px);
    display: flex;
    flex-direction: column;
    .vchart-row{
      width: 100%;
      height: 50%;
      display: flex;
      .vchart-item{
        border:1px solid #135f9e;
        margin:5px;
        flex-shrink: 0;
        width: 33%;
        height: calc(100% - 10px);
      }
    }
  }

}

</style>
